Merged
Conversation
- Add jprove.bat: Windows batch wrapper for jprove test harness - Fix jperl/jperl.bat: Apply --sun-misc-unsafe-memory-access=allow only for Java 24+ (flag introduced in Java 23, default changed to 'warn' in Java 24 per JEP 498) - Add FFM migration design doc: Plan to replace JNR-POSIX with Java FFM API - Update testing.md: Document Windows support for jprove Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add FFM framework for replacing JNR-POSIX with Java Foreign Function & Memory API: - FFMPosixInterface.java: Interface defining all POSIX functions - FFMPosix.java: Factory with platform detection (Linux/macOS/Windows) - FFMPosixLinux.java: Linux stub implementation - FFMPosixMacOS.java: macOS stub (extends Linux) - FFMPosixWindows.java: Windows implementation with Java/ProcessHandle fallbacks - PosixLibrary.java: Add FFM integration points and feature flag docs Feature flag: -Dperlonjava.ffm.enabled=true or PERLONJAVA_FFM_ENABLED=true All methods throw UnsupportedOperationException in stubs, indicating JNR-POSIX should be used until FFM implementations are complete. See dev/design/ffm_migration.md for the full migration plan. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Phase 5 now includes explicit steps for updating: - build.gradle - pom.xml - CI workflows - Documentation (README, QUICKSTART, installation guide, presentations) Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
… API - Implement FFM-based getuid, geteuid, getgid, getegid, getppid, umask, chmod, kill, isatty for Linux/macOS - Add $< (REAL_UID) and $> (EFFECTIVE_UID) special variables with lazy evaluation - Fix getppid JVM bytecode emission - was falling through to varargs handler - Update Java version requirement to 22 (FFM finalized in Java 22) The FFM implementation provides direct native calls without JNA overhead. JNR-POSIX is still used as fallback for Windows and complex structs. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add platform-specific struct stat layouts for Linux x86_64 and macOS - Implement stat() and lstat() with proper errno capture - Read struct fields with correct byte offsets for each platform - Tested: values match native Perl exactly on macOS Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…, etc.) - Add method handles for getpwnam, getpwuid, getpwent, setpwent, endpwent - Define platform-specific struct passwd layouts for Linux and macOS - Implement readPasswdEntry() to parse native passwd struct - Add helper readCString() for reading null-terminated strings from native memory Phase 3 (struct-based functions) is now complete with stat, lstat, and passwd functions. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Phase 6 of FFM migration: complete removal of JNR-POSIX dependency. Changes: - Remove jnr-posix from build.gradle and libs.versions.toml - Simplify PosixLibrary.java (FFM only, no JNR-POSIX fallback) - Remove --sun-misc-unsafe-memory-access flag from jperl/jperl.bat - Update documentation to remove sun.misc.Unsafe references All native POSIX calls now use Java Foreign Function & Memory (FFM) API: - NativeUtils: getuid, geteuid, getgid, getegid, getpid, getppid - Stat: stat, lstat with platform-specific struct layouts - KillOperator: kill signal handling - Operator: chmod file permissions - FileTestOperator, DebugHooks: isatty terminal detection - UmaskOperator: umask file creation mask - IOOperator: fcntl file descriptor control - UtimeOperator: utimes file timestamp modification - WaitpidOperator: waitpid process management - ExtendedNativeUtils: getpwnam, getpwuid, getpwent, setpwent, endpwent - POSIX: strerror error messages Benefits: - No more sun.misc.Unsafe deprecation warnings on Java 24+ - Reduced dependency footprint - Uses standard Java API (FFM finalized in Java 22) Tested: All 122 unit tests pass. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
FFM (Foreign Function & Memory) API was finalized in Java 22 (JEP 454). In Java 21, FFM is still a preview API which causes compilation errors. Changes: - Update CI workflow to use Java 22 - Update pom.xml compiler source/target to 22 - Remove JNR-POSIX from pom.xml dependencies - Update QUICKSTART.md, installation.md, java-integration.md - Update presentation slides - Update Dockerfile to use eclipse-temurin:22-jdk - Update build.gradle comment Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The Dockerfile had an outdated JAR reference (3.0.0) that was missed during previous version updates. Now that it matches the current version, Configure.pl will correctly update it on future version changes. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR migrates PerlOnJava from JNR-POSIX to Java's Foreign Function & Memory (FFM) API (JEP 454), eliminating the
sun.misc.Unsafewarnings on Java 24+.Problem
JNR-POSIX depends on JFFI, which uses
sun.misc.Unsafefor native memory access. Starting with Java 24 (JEP 498), warnings are issued by default, and these methods are scheduled for removal.Solution
Migrate to Java's FFM API (finalized in Java 22), which provides a safe, supported replacement for native function calls.
Changes
Phase 1-2: Infrastructure & Simple Functions
Phase 3: Struct-Based Functions
Phase 4-5: Windows Support & Migration
Phase 6: Cleanup
--sun-misc-unsafe-memory-accessflag from jperl/jperl.batFiles Migrated to FFM
Design Doc
See
dev/design/ffm_migration.mdfor implementation details.Test Plan
makeGenerated with Devin